package com.woniuxy.exception;

import com.woniuxy.dto.JsonResultDto;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(Exception.class)
    public JsonResultDto exceptionHandler(Exception e){
        return new JsonResultDto("500",null,null,null);
    }

    @ExceptionHandler(MyRuntimeException.class)
    public JsonResultDto runtimeException(Exception e){
        return new JsonResultDto("8989",e.getMessage(),null,null);
    }
}
